package de.mssp.sensorkit.gps;

import de.mssp.sensorkit.*;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;

import android.os.Bundle;

public class GPSActivity extends MapActivity 
{	
	MapView mapView;
	MyLocationOverlay myLocationOverlay;
	
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
    	super.onCreate(savedInstanceState);
    	setContentView(R.layout.gps);
    	
    	//Create Map
    	mapView = (MapView) findViewById(R.id.mapview);
    	mapView.setBuiltInZoomControls(true);
    	
    	//Create own Location Overlay
		myLocationOverlay = new MyLocationOverlay(this, mapView);		
		myLocationOverlay.enableCompass();
		myLocationOverlay.enableMyLocation();
		
		//Add overlay to map
		mapView.getOverlays().add(myLocationOverlay);
    }
    
    @Override
    public void onResume(){
    	super.onResume();
    	myLocationOverlay.enableCompass();
		myLocationOverlay.enableMyLocation();
    }
    
    @Override
    public void onPause(){
    	super.onPause();
    	myLocationOverlay.disableCompass();
    	myLocationOverlay.disableMyLocation();
    }

	@Override
	protected boolean isRouteDisplayed() 
	{
		// TODO Auto-generated method stub
		return false;
	}
}
